﻿Public Class frmExportvaImportToExcel
    Public duongdan As String = ""
    Private Sub frmExportvaImportToExcel_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

#Region "xuất ra file excel"
    Private Sub btnChonLuuFileBackup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnChonLuuFileBackup.Click
        Dim folder As New FolderBrowserDialog()
        With folder
            If .ShowDialog = Windows.Forms.DialogResult.OK Then
                txtLuuFileBackup.Text = .SelectedPath
            End If
        End With
    End Sub
    Private Sub btnBiSaoLuu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBiSaoLuu.Click
        duongdan = ""
        Me.Close()
    End Sub

    Private Sub btnSaoLuu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaoLuu.Click
        If txtLuuFileBackup.Text = "" Then
            MessageBox.Show("Bạn phải chọn nơi lưu file!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information)
            txtLuuFileBackup.Focus()
            Exit Sub
        ElseIf txtTenFileBackup.Text = "" Then
            MessageBox.Show("Bạn phải đặt tên cho file muốn lưu trữ!.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information)
            txtTenFileBackup.Focus()
            Exit Sub
        End If
        duongdan = txtLuuFileBackup.Text + "\" + txtTenFileBackup.Text + ".xls"
        Me.Close()
    End Sub
#End Region
End Class